package com.datas.utils.hibernatebasebean;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by jige0727 on 2016/12/22.
 * 基础bean
 */
@MappedSuperclass
public class BaseHibernateEntity {
    @Setter
    private Integer id;
    @Getter
    @Setter
    @DateTimeFormat
    private Date create_date = new Date();
    @Getter
    @Setter
    @DateTimeFormat
    private Date modify_date = new Date();
    @Getter
    @Setter
    private Integer disabled = 0; //是否已禁用 1是 0不是
    @Getter
    @Setter
    private String remark;// 备注

    @Id
    @GeneratedValue(generator = "increment")
    @GenericGenerator(name = "increment", strategy = "increment")
    public Integer getId() {
        return id;
    }
}
